package com.qiji.video.service.impl;

import com.qiji.video.bean.VideoType;
import com.qiji.video.mapper.VideoTypeMapper;
import com.qiji.video.mapper.extend.VideoTypeExtendMapper;
import com.qiji.video.service.ITypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TypeServiceImpl implements ITypeService {
    @Autowired
    private VideoTypeMapper videoTypeMapper;
    @Autowired
    private VideoTypeExtendMapper videoTypeExtendMapper;
    @Override
    public List<VideoType> selectAllType() {
        return videoTypeExtendMapper.selectAllType();
    }

    @Override
    public void updateType(VideoType videoType) {
        videoTypeMapper.updateByPrimaryKeySelective(videoType);
    }

    @Override
    public void addVideoType(VideoType videoType) {
        videoTypeMapper.insertSelective(videoType);
    }

    @Override
    public void deleteVideoType(int id) {
        videoTypeMapper.deleteByPrimaryKey(id);
    }
}
